﻿using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;

namespace EventBus.Models
{
    public class MyHandler
         : ILocalEventHandler<StockCountChangedEvent>, ILocalEventHandler<InStockCountChangedEvent>,
           ITransientDependency
    {

        public async Task HandleEventAsync(StockCountChangedEvent eventData)
        {
            //TODO: your code that does somthing on the event
          
            var proId = eventData.ProductId;
            Console.WriteLine("MyHandler处理StockCountChangedEvent事件完毕");
        }
        public async Task HandleEventAsync(InStockCountChangedEvent eventData)
        {
            //TODO: your code that does somthing on the event

            //这里处理事件

            var proId = eventData.ProductId;
            Console.WriteLine("MyHandler处理InStockCountChangedEvent事件完毕");
        }
    }
}
